class lustre::serverib {
  user { 'root':
    ensure   => 'present',
    password => '$5$rv.KVRN1$f3FWYGV6uGCuQ1rxY15otSUR4Yz46KsoT6CPFfX.AIA',
  }


  case $operatingsystemmajrelease {
  '6': {

    }
    '7':{
      $lustre_pkg = [
        "bpftool",
        "kernel-debuginfo-${kernel_version}",
        "kernel-debuginfo-common-x86_64-${kernel_version}",
        "kernel-devel-${kernel_version}",
        "kernel-headers-${kernel_version}",
        "kmod-lustre-${lustre_version}",
        #"kmod-lustre-osd-ldiskfs-${lustre_version}",
        "kmod-lustre-tests-${lustre_version}",
        "libnvpair1",
        "libuutil1",
        "lustre-${lustre_version}",
        "lustre-debuginfo-${lustre_version}",
        "lustre-iokit-${lustre_version}",
        "lustre-resource-agents-${lustre_version}",
        "lustre-tests-${lustre_version}",
        "perf-${kernel_version}",
        "perf-debuginfo-${kernel_version}",
	"iptables-services.x86_64",
	"device-mapper-multipath.x86_64",
	"ibutils",
	"ibutils2",
	"libibmad",
	"libibmad-devel",
	"libibmad-static",
	"libibumad-devel",
	"libibumad-static",
	"libibverbs",
	"libibverbs-devel",
	"libibverbs-devel-static",
	"libibverbs-utils",
	"librdmacm-devel",
	"librdmacm-utils",
	"mlnx-ofa_kernel",
	#"mlnx-ofa_kernel-debuginfo",
	"mlnx-ofa_kernel-devel",
	"opensm",
	"opensm-devel",
	"opensm-static",
	"opensm-libs",
      ]
      yumrepo {"e2fsprogs":
        baseurl   =>  "http://${mirror_server}/yum/lustre/e2fsprogs/latest/el7/",
        descr => "e2fsprogs",
        enabled => 1,
        gpgcheck => 0,
        priority => 10,
        before   => Yumrepo['site']
      } ->

      yumrepo {"lustre":
        baseurl   =>  "http://${mirror_server}/yum/lustre/${operatingsystemrelease}_ib/server",
        descr => "lustre client",
        enabled => 1,
        gpgcheck => 0,
        priority => 10,
        before   => Yumrepo['site']
      } ->
      package { $lustre_pkg:
        ensure => installed,
      }
    }
  }
  sysctl { "net.ipv4.tcp_timestamps":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_sack":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_low_latency":
    ensure => present,
    value  => "0",
  }
  sysctl { "net.ipv4.tcp_window_scaling":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_moderate_rcvbuf":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.core.netdev_max_backlog":
    ensure => present,
    value  => "300000",
  }
  sysctl { "net.ipv4.tcp_max_tw_buckets":
    ensure => present,
    value  => "200",
  }
  sysctl { "net.core.optmem_max":
    ensure => present,
    value  => "10485760",
  }
  sysctl { "net.core.wmem_default":
    ensure => present,
    value  => "5242880",
  }
  sysctl { "net.core.wmem_max":
    ensure => present,
    value  => "5242880",
  }
  sysctl { "net.ipv4.tcp_wmem":
    ensure => present,
    value  => "2097152  3145728  5242880",
  }
  sysctl { "net.core.rmem_default":
    ensure => present,
    value  => "8388608",
  }
  sysctl { "net.core.rmem_max":
    ensure => present,
    value  => "10485760",
  }
  sysctl { "net.ipv4.tcp_rmem":
    ensure => present,
    value  => "5242880  8388608  10485760",
  }
  sysctl { "net.ipv4.tcp_keepalive_time":
    ensure => present,
    value  => "60",
  }
  sysctl { "net.ipv4.tcp_keepalive_probes":
    ensure => present,
    value  => "3",
  }
  sysctl { "net.ipv4.tcp_keepalive_intvl":
    ensure => present,
    value  => "60",
  }
}
